package com.auth.service.api.fenignInterface;

import com.auth.service.api.AuthResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @Author:RenPu
 * @Date: 2020/10/28 18:59
 * @Version: 1.0
 * @description:供远程调用的接口设计
 */

@FeignClient("author-server")
public interface AuthService {


    /**
     * jwt鉴权的用户登录
     *
     * @param username
     * @param password
     * @return
     */
    @PostMapping("login")
    @ResponseBody
    public AuthResponseResult login(@RequestParam("username") String username
            , @RequestParam("password") String password);


    /**
     * jwt鉴权用户token的检验
     *
     * @param username
     * @param token
     * @return
     */
    @GetMapping("verify")
    public AuthResponseResult verify(@RequestParam("username") String username
            , @RequestParam("token") String token);


    /**
     * jwt用户登录检验重新签发token
     *
     * @param refresh
     * @return
     */
    @PostMapping("refresh")
    @ResponseBody
    public AuthResponseResult refresh(@RequestParam("refresh") String refresh);


}
